
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>绑定用户 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="17.html" />
    
    
    <link rel="prev" href="15.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    [第一章 系统介绍]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="1.html">
            
                <a href="1.html">
            
                    
                    系统介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="2.html">
            
                <a href="2.html">
            
                    
                    功能特点
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    [第二章 快速上手]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="3.html">
            
                <a href="3.html">
            
                    
                    源码地址
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="4.html">
            
                <a href="4.html">
            
                    
                    服务部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="5.html">
            
                <a href="5.html">
            
                    
                    集成开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="6.html">
            
                <a href="6.html">
            
                    
                    源码测试
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    [第三章 架构分析]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="7.html">
            
                <a href="7.html">
            
                    
                    系统架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="8.html">
            
                <a href="8.html">
            
                    
                    服务依赖关系
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="9.html">
            
                <a href="9.html">
            
                    
                    协议格式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="10.html">
            
                <a href="10.html">
            
                    
                    消息类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="11.html">
            
                <a href="11.html">
            
                    
                    系统配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="12.html">
            
                <a href="12.html">
            
                    
                    功能模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="13.html">
            
                <a href="13.html">
            
                    
                    SPI定制化
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    [第四章 深度进阶]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="14.html">
            
                <a href="14.html">
            
                    
                    秘钥交换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="15.html">
            
                <a href="15.html">
            
                    
                    握手及快速重连
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.5.3" data-path="16.html">
            
                <a href="16.html">
            
                    
                    绑定用户
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="17.html">
            
                <a href="17.html">
            
                    
                    消息推送流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="18.html">
            
                <a href="18.html">
            
                    
                    HTTP代理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="19.html">
            
                <a href="19.html">
            
                    
                    消息分发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="20.html">
            
                <a href="20.html">
            
                    
                    消息序列化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="21.html">
            
                <a href="21.html">
            
                    
                    消息加密与压缩
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.9" data-path="22.html">
            
                <a href="22.html">
            
                    
                    线程池配置与定制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.10" data-path="23.html">
            
                <a href="23.html">
            
                    
                    上行PUSH
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.11" data-path="24.html">
            
                <a href="24.html">
            
                    
                    广播推送与流控
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.12" data-path="25.html">
            
                <a href="25.html">
            
                    
                    广播推送条件过滤
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.13" data-path="26.html">
            
                <a href="26.html">
            
                    
                    消息ACK
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.14" data-path="27.html">
            
                <a href="27.html">
            
                    
                    离线消息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.15" data-path="28.html">
            
                <a href="28.html">
            
                    
                    服务端启动流程分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.16" data-path="29.html">
            
                <a href="29.html">
            
                    
                    日志模块性能优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.17" data-path="30.html">
            
                <a href="30.html">
            
                    
                    JVM监控与性能分析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    [第五章 关联服务]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="31.html">
            
                <a href="31.html">
            
                    
                    Alloc服务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="32.html">
            
                <a href="32.html">
            
                    
                    MPNS
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" >
            
                <span>
            
                    
                    [第六章 SDK接入]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="33.html">
            
                <a href="33.html">
            
                    
                    服务端SDK
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="34.html">
            
                <a href="34.html">
            
                    
                    Android SDK
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="35.html">
            
                <a href="35.html">
            
                    
                    MPushClient(Java)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="36.html">
            
                <a href="36.html">
            
                    
                    MPushClient(Swift)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="37.html">
            
                <a href="37.html">
            
                    
                    MPushClient(Obj-C)
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" >
            
                <span>
            
                    
                    [第七章 常见问题]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="38.html">
            
                <a href="38.html">
            
                    
                    常见问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="39.html">
            
                <a href="39.html">
            
                    
                    系统压测
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >绑定用户</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x7ED9;&#x8FDE;&#x63A5;&#x7ED1;&#x5B9A;&#x7528;&#x6237;">&#x7ED9;&#x8FDE;&#x63A5;&#x7ED1;&#x5B9A;&#x7528;&#x6237;</h1>
<h3 id="&#x65F6;&#x5E8F;&#x56FE;">&#x65F6;&#x5E8F;&#x56FE;</h3>
<p><img src="images/1.JPG?raw=true" align="center"></p>
<h2 id="&#x8BF4;&#x660E;">&#x8BF4;&#x660E;</h2>
<p>1.&#x63E1;&#x624B;&#x6210;&#x529F;&#x540E;&#x8868;&#x793A;&#x5B89;&#x5168;&#x901A;&#x9053;&#x5DF2;&#x7ECF;&#x5EFA;&#x7ACB;&#xFF0C;&#x4F46;&#x540C;&#x65F6;&#x8FD8;&#x8981;&#x7ED9;&#x8FDE;&#x63A5;&#x8BBE;&#x7F6E;&#x7528;&#x6237;&#x751A;&#x81F3;&#x6807;&#x7B7E;&#xFF0C;&#x53EA;&#x6709;&#x8FD9;&#x6837;&#x4E1A;&#x52A1;&#x624D;&#x80FD;&#x66F4;&#x597D;&#x7684;&#x53BB;&#x8BC6;&#x522B;&#x7528;&#x6237;&#xFF08;&#x6CA1;&#x6709;&#x7528;&#x6237;&#x7684;&#x4E1A;&#x52A1;&#x662F;&#x53E6;&#x5916;&#x4E00;&#x56DE;&#x4E8B;&#xFF09;&#x3002;</p>
<p>2.&#x8BBE;&#x7F6E;&#x7528;&#x6237;&#x975E;&#x5E38;&#x7B80;&#x5355;&#xFF0C;&#x53EA;&#x9700;&#x628A;&#x5176;&#x5B58;&#x50A8;&#x5230;session&#x5373;&#x53EF;&#xFF0C;&#x4F46;&#x56E0;&#x4E3A;&#x8981;&#x652F;&#x6301;&#x96C6;&#x7FA4;&#x7684;&#xFF0C;&#x5C31;&#x5FC5;&#x987B;&#x628A;&#x7528;&#x6237;&#x7684;&#x4F4D;&#x7F6E;&#x4FE1;&#x606F;&#xFF08;&#x6216;&#x8005;&#x53EB;&#x8DEF;&#x7531;&#x4FE1;&#x606F;&#xFF09;&#x53D1;&#x5E03;&#x51FA;&#x53BB;&#xFF0C;&#x8BA9;&#x96C6;&#x7FA4;&#x91CC;&#x7684;&#x5176;&#x4ED6;&#x673A;&#x5668;&#x80FD;&#x591F;&#x901A;&#x8FC7;useId&#x6765;&#x67E5;&#x627E;&#x7528;&#x6237;&#x7684;&#x4F4D;&#x7F6E;&#xFF08;&#x5728;&#x54EA;&#x53F0;&#x673A;&#x5668;&#xFF09;&#xFF0C;&#x56E0;&#x4E3A;&#x5BA2;&#x6237;&#x7AEF;&#x7684;TCP&#x8FDE;&#x63A5;&#x5728;&#x54EA;&#x53F0;&#x673A;&#x5668;&#xFF0C;&#x90A3;&#x4E48;&#x548C;&#x8FD9;&#x4E2A;&#x5BA2;&#x6237;&#x7AEF;&#x7684;&#x6240;&#x6709;&#x6570;&#x636E;&#x4F20;&#x8F93;&#x90FD;&#x5FC5;&#x987B;&#x7ECF;&#x8FC7;&#x8FD9;&#x53F0;&#x673A;&#x5668;&#x7684;&#x8FD9;&#x4E2A;&#x8FDE;&#x63A5;&#xFF01;(&#x5F88;&#x591A;&#x540C;&#x5B66;&#x4F1A;&#x95EE;&#x4E3A;&#x4EC0;&#x4E48;&#x4E0D;&#x628A;connection&#x5B58;&#x50A8;&#x5230;redis)&#x3002;</p>
<p>3.&#x8DEF;&#x7531;&#x4E2D;&#x5FC3;&#x6709;&#x4E24;&#x90E8;&#x5206;&#x7EC4;&#x6210;&#xFF1A;&#x672C;&#x5730;&#x8DEF;&#x7531;&#x548C;&#x8FDC;&#x7A0B;&#x8DEF;&#x7531;&#xFF0C;&#x672C;&#x5730;&#x8DEF;&#x7531;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x4E3A;userId-&gt;connection&#x7684;map&#xFF0C;&#x6570;&#x636E;&#x5B58;&#x50A8;&#x5728;&#x672C;&#x673A;&#x5185;&#x5B58;&#xFF1B;&#x8FDC;&#x7A0B;&#x8DEF;&#x7531;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x4E3A;userId-&gt;connServer&#x673A;&#x5668;ip&#xFF0C;&#x6570;&#x636E;&#x5B58;&#x50A8;&#x5728;redis;&#x6240;&#x4EE5;&#x8981;&#x7ED9;&#x4E00;&#x4E2A;&#x7528;&#x6237;&#x53D1;&#x4FE1;&#x606F;&#x5FC5;&#x987B;&#x5148;&#x67E5;&#x8FDC;&#x7A0B;&#x8DEF;&#x7531;&#xFF0C;&#x627E;&#x5230;&#x7528;&#x6237;&#x5728;&#x54EA;&#x53F0;&#x673A;&#x5668;&#xFF0C;&#x7136;&#x540E;&#x628A;&#x6D88;&#x606F;&#x53D1;&#x7ED9;&#x8FD9;&#x53F0;&#x673A;&#x5668;&#xFF0C;&#x8BA9;&#x5176;&#x53BB;&#x672C;&#x5730;&#x8DEF;&#x7531;&#x67E5;&#x627E;connection&#x5E76;&#x901A;&#x8FC7;&#x67E5;&#x627E;&#x5230;&#x7684;TCP&#x8FDE;&#x63A5;&#x628A;&#x6D88;&#x606F;&#x53D1;&#x7ED9;&#x7528;&#x6237;&#x3002;</p>
<p>4.MessageCenter&#x4E4B;&#x524D;&#x4F7F;&#x7528;&#x7684;redis&#x63D0;&#x4F9B;&#x7684;pub/sub&#x5B9E;&#x73B0;&#x7684;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x81EA;&#x5DF1;&#x642D;&#x5EFA;MQ&#x6765;&#x5B9E;&#x73B0;&#xFF0C;&#x6700;&#x65B0;&#x7248;&#x8E22;&#x4EBA;&#x5DF2;&#x7ECF;&#x4E0D;&#x518D;&#x4F7F;&#x7528;pub/sub&#xFF0C;&#x800C;&#x662F;&#x76F4;&#x63A5;&#x4F7F;&#x7528;udp&#x7F51;&#x5173;&#x5B9E;&#x73B0;&#x3002;</p>
<p>5.&#x8E22;&#x4EBA;&#xFF1A;&#x4E4B;&#x6240;&#x4EE5;&#x4F1A;&#x6709;&#x8E22;&#x4EBA;&#x7684;&#x60C5;&#x51B5;&#x662F;&#x6839;&#x636E;&#x4E1A;&#x52A1;&#x9700;&#x8981;&#x6765;&#x7684;&#xFF0C;&#x6709;&#x4E9B;&#x4E1A;&#x52A1;&#x7CFB;&#x7EDF;&#x662F;&#x4E0D;&#x5141;&#x8BB8;&#x540C;&#x4E00;&#x4E2A;&#x7528;&#x6237;&#x5728;&#x591A;&#x4E2A;&#x8BBE;&#x5907;&#x540C;&#x65F6;&#x5728;&#x7EBF;&#x7684;&#xFF0C;&#x6216;&#x8005;&#x53EA;&#x5141;&#x8BB8;&#x4E0D;&#x540C;&#x7C7B;&#x578B;&#x7684;&#x7EC8;&#x7AEF;&#x540C;&#x65F6;&#x5728;&#x7EBF;&#xFF0C;&#x6BD4;&#x5982;QQ,&#x624B;&#x673A;&#x548C;PC&#x53EF;&#x4EE5;&#x540C;&#x65F6;&#x5728;&#x7EBF;&#xFF0C;&#x4F46;&#x540C;&#x4E00;&#x4E2A;&#x5E10;&#x53F7;&#x5728;&#x4E24;&#x53F0;PC&#x767B;&#x5F55;&#x65F6;&#x5176;&#x4E2D;&#x4E00;&#x4E2A;&#x80AF;&#x5B9A;&#x4F1A;&#x88AB;&#x8E22;&#x4E0B;&#x7EBF;&#xFF0C;mpush&#x7684;&#x8E22;&#x4EBA;&#x8981;&#x8868;&#x8FBE;&#x7684;&#x4E5F;&#x662F;&#x540C;&#x4E00;&#x4E2A;&#x610F;&#x601D;&#x3002;</p>
<p>6.&#x987A;&#x4FBF;&#x63D0;&#x4E00;&#x4E0B;&#x5173;&#x4E8E;&#x540C;&#x65F6;&#x5728;&#x7EBF;&#x7684;&#x7B56;&#x7565;&#xFF0C;&#x6216;&#x8005;&#x8BF4;&#x7AEF;&#x7684;&#x7C7B;&#x578B;&#x7684;&#x5B9A;&#x4E49;mpush&#x5DF2;&#x7ECF;&#x652F;&#x6301;SPI&#x5B9A;&#x5236;&#x5316;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="15.html" class="navigation navigation-prev " aria-label="Previous page: 握手及快速重连">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="17.html" class="navigation navigation-next " aria-label="Next page: 消息推送流程">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"绑定用户","level":"1.5.3","depth":2,"next":{"title":"消息推送流程","level":"1.5.4","depth":2,"path":"17.md","ref":"17.md","articles":[]},"previous":{"title":"握手及快速重连","level":"1.5.2","depth":2,"path":"15.md","ref":"15.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"16.md","mtime":"2023-05-21T16:24:04.707Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2023-06-26T16:20:41.295Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

